#ifndef __CNF_H__
#define __CNF_H__

#include "clause.h"

#define MAX_CLAUSE  10000
typedef struct _cnf{
    int nclause;
    int nvar;
    int n_univar;    
    clause* clause_set;
    int * clause_start;
    int *clause_varn;
    variable* vars;
    variable* var_set;
}cnf;

/**
 * init the original cnf
 */
void init_ori_cnf(cnf* cnf);
cnf* new_cnf_from(const cnf* c2);
cnf* new_cnf_addclause(const cnf* c2, clause* cls);
void delete_cnf(cnf* cnf);
void init_cnf(cnf* cnf);
void add_clause(cnf*cnf, clause* cls);
void print_cnf(cnf* const cnf);

/**
 * used by mpi
 */
unsigned count_assigned(variable* vars, int var_num);
void unset_all_vars(cnf* _cnf);
void _set_variable_value(cnf* cnf, int name, _bool value);
#endif